<!DOCTYPE html>
<html ng-app="myApp">

<head>
    <meta charset="utf-8">
    <script src=" https://code.angularjs.org/1.6.4/angular.js">

    </script>
</head>

<body>

    <div ng-controller="myCtrl1">
       <h1>{{lastname}}家庭成员:</h1>
    </div>
    
    <div ng-controller="myCtrl">
       <h1>{{lastname}}家庭成员:</h1>
       <ul>
           <li ng-repeat="x in names">{{x}} {{lastname}}</li>
       </ul>
    </div>

    <script>
        var app = angular.module('myApp', []);

        app.controller('myCtrl', function($scope, $rootScope) {
            $scope.names = ["Emil", "Tobias", "Linus"];
            $rootScope.lastname = "Refsnes";
        });

        app.controller('myCtrl1', function($scope, $rootScope) {
          
        });
    </script>

</body>

</html>